// bun add @elysiajs/cron
// 定时任务
import { Elysia } from 'elysia'
import { cron } from '@elysiajs/cron'


export const task = new Elysia({ prefix: '/task' })
    .use(
        cron({
            name: 'heartbeat',
            pattern: '*/10 * * * * *',
            run() {
                const currentTime = new Date();
                console.log('Heartbeat')
                console.log(currentTime)
            }
        })
    )